groupby in laravel with count

30

$getUserCountries = User::select('country', DB::raw('count(*) as count'))
                          ->groupBy('country')
                          ->get()->
                          toArray();

Comments

Submit
0 Comments